package net.kansun.impl;

import net.kansun.Parser;

/**
 * An implementation of {@link Parser} that parses a single digit to its corresponding English word.
 * Note that this parser is not supposed to handle '0 -> zero' so as to minimise noises brought about
 * when there are many zeros contained in the source number.
 */
public class UnitParser extends AbstractIrregularParser {

   @Override
   public String parse(Long source) {

      final String retVal = getMappings().get(source);

      if (retVal == null) {
         return "";
      } else {
         return retVal;
      }
   }

}
